<?php if(!is_null($hospital)): ?>
    <h3 class="text-center margin-bottom-20"><?php echo e($hospital->name); ?></h3>
<?php endif; ?>

<div class="baseMessage">
    <p>
        <span class="title">&nbsp;姓&nbsp;&nbsp;&nbsp;名：</span>
        <span class="content">&nbsp;&nbsp;<?php echo e($patient['name']); ?></span>
    </p>

    <p>
        <span class="title">病案号：</span>
        <span class="content">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo e($patient['medical_number']); ?></span>
    </p>

    <p>
        <span class="title">就诊日期：</span>
        <span class="content"><?php echo e($record['clinic_at']); ?></span>
    </p>

    <p>
        <span class="title">科室：</span>
        <span class="content">内分泌科</span>
    </p>

    <p>
        
        <span class="content"><?php echo e($patient->sex['value']); ?></span> /
        <span class="content"><?php echo e($patient['age']); ?> 岁</span>
    </p>

    
    
    
    

    
    
    
    
</div>

<?php if(isset($complaint) && !is_null($complaint)): ?>
    <div>
        <?php if(!isEmpty($complaint)): ?>
            <p class="caseTitle">主诉</p>
        <?php endif; ?>
        <div>
            <?php $__currentLoopData = $complaint['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <p><?php echo e($item); ?></p>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if(is_array($complaint['model']['medication'])): ?>
                用药：
                <?php $__currentLoopData = $complaint['model']['medication']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <span>
                            <?php echo e(fr($item, 'start_time',"：")); ?>

                        <?php echo e(fr($item, 'name','，')); ?>

                        <?php echo e(fr($item,'dosage.type','，')); ?>

                        <?php if('每次剂量' == fr($item,'dosage.type')): ?>
                            <?php echo e($item['dosage']['value'],'，'); ?>

                        <?php else: ?>
                            <?php echo e(fe($item, 'dosage.values.morning', '早', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.atnoon', '中', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.evening', '晚', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.before_sleep', '睡前', '，')); ?>

                        <?php endif; ?>
                        <?php echo e(fr($item, 'dosage.unit','，')); ?>

                        <?php echo e(fr($item, 'usage','，')); ?>

                        <?php echo e(fr($item, 'frequency',' ')); ?>

                        <?php echo e(fr($item, 'remark',' ')); ?>；
                        </span>
                    
                    
                    
                    

                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

            <?php endif; ?>
            <?php if(isset($complaint['model']->remark)&&!is_null($complaint['model']->remark)&&''!=$complaint['model']->remark): ?>
                <p>备注信息：<?php echo e($complaint['model']->remark); ?></p>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>


<div>
    <?php if($record['visit_type']['key']): ?>
        <?php if((isset($hpiSub) && !is_null($hpiSub)) || (isset($follow) && !is_null($follow))): ?>
            <p class="caseTitle">现病史</p>
        <?php endif; ?>
        <?php if(isset($hpiSub) && !is_null($hpiSub)): ?>
            <?php $__currentLoopData = $hpiSub; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sub): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div>
                    <?php $__currentLoopData = $sub['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $print): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <span><?php echo e($print); ?></span>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>

                <?php if($sub['model']->medication): ?>
                    <?php $__currentLoopData = (array)$sub['model']->medication; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <p>
                            <?php echo e(fr($item, 'start_time',"：")); ?>

                            <?php echo e(fr($item, 'name','，')); ?>

                            <?php echo e(fr($item,'dosage.type','，')); ?>

                            <?php if('每次剂量' == fr($item,'dosage.type')): ?>
                                <?php echo e($item['dosage']['value'],'，'); ?>

                            <?php else: ?>
                                <?php echo e(fe($item, 'dosage.values.morning', '早', '，')); ?>

                                <?php echo e(fe($item, 'dosage.values.atnoon', '中', '，')); ?>

                                <?php echo e(fe($item, 'dosage.values.evening', '晚', '，')); ?>

                                <?php echo e(fe($item, 'dosage.values.before_sleep', '睡前', '，')); ?>

                            <?php endif; ?>
                            <?php echo e(fr($item, 'dosage.unit','，')); ?>

                            <?php echo e(fr($item, 'usage','，')); ?>

                            <?php echo e(fr($item, 'frequency',' ')); ?>

                            <?php echo e(fr($item, 'remark',' ')); ?>

                        </p>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
                <?php if($sub['model']->cn_medication): ?>
                    <?php $__currentLoopData = (array)$sub['model']->cn_medication; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if(!isset($item['type']) || $item['type'] == 1): ?>
                            <p>
                                <?php $__currentLoopData = $item['drugs']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $drug): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php echo e($drug['name']); ?> <?php echo e($drug['weight']); ?>g
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php echo e(fe($item, 'usage', '煎法：', '，')); ?>

                                <?php echo e(fe($item, 'dosage', '频次：', '，')); ?>

                                <?php echo e(fe($item, 'frequency', '', '，')); ?>

                                <?php echo e(fe($item, 'dose', '总数：', '付')); ?>

                            </p>
                        <?php elseif($item['type'] == 3): ?>
                            <p>
                                <?php echo e(fe($item, 'name')); ?>

                                <?php echo e(fe($item, 'start_time', '开始于', '，')); ?>

                                <?php echo e(fe($item, 'end_time', '结束于', '，')); ?>

                                <?php echo e(fe($item, 'times_per_day', '每日', '次，')); ?>

                                <?php echo e(fe($item, 'quantity_per_times', '每次')); ?>

                                <?php echo e(fe($item, 'quantity_unit', '', '，')); ?>

                                <?php echo e(fe($item, 'total', '共', '盒，')); ?>

                            </p>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php endif; ?>
        <?php if(isset($hpi) && !is_null($hpi)): ?>
            <?php if(isset($hpi) && !is_null($hpi)): ?>
                <?php $__currentLoopData = $hpi['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <p><?php echo e($item); ?></p>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php if(isset($hpi['model']->remark)&&!is_null($hpi['model']->remark)&&''!=$hpi['model']->remark): ?>
                    <p>备注信息：<?php echo e($hpi['model']->remark); ?></p>
                <?php endif; ?>
            <?php endif; ?>
        <?php endif; ?>
    <?php else: ?>
        <?php if((isset($hpiSub) && !is_null($hpiSub)) || (isset($follow) && !is_null($follow))): ?>
            <p class="caseTitle">随诊</p>
        <?php endif; ?>
        <?php if(isset($hpiSub) && !is_null($hpiSub)): ?>
            <?php $__currentLoopData = $hpiSub; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sub): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div>
                    <?php $__currentLoopData = $sub['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $print): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <span><?php echo e($print); ?></span>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>

                <?php if($sub['model']->medication): ?>
                    <?php $__currentLoopData = (array)$sub['model']->medication; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <p>
                            <?php echo e(fr($item, 'start_time',"：")); ?>

                            <?php echo e(fr($item, 'name','，')); ?>

                            <?php echo e(fr($item,'dosage.type','，')); ?>

                            <?php if('每次剂量' == fr($item,'dosage.type')): ?>
                                <?php echo e($item['dosage']['value'],'，'); ?>

                            <?php else: ?>
                                <?php echo e(fe($item, 'dosage.values.morning', '早', '，')); ?>

                                <?php echo e(fe($item, 'dosage.values.atnoon', '中', '，')); ?>

                                <?php echo e(fe($item, 'dosage.values.evening', '晚', '，')); ?>

                                <?php echo e(fe($item, 'dosage.values.before_sleep', '睡前', '，')); ?>

                            <?php endif; ?>
                            <?php echo e(fr($item, 'dosage.unit','，')); ?>

                            <?php echo e(fr($item, 'usage','，')); ?>

                            <?php echo e(fr($item, 'frequency',' ')); ?>

                            <?php echo e(fr($item, 'remark',' ')); ?>

                        </p>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
                <?php if($sub['model']->cn_medication): ?>
                    <?php $__currentLoopData = (array)$sub['model']->cn_medication; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if(!isset($item['type']) || $item['type'] == 1): ?>
                            <p>
                                <?php $__currentLoopData = $item['drugs']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $drug): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php echo e($drug['name']); ?> <?php echo e($drug['weight']); ?>g
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php echo e(fe($item, 'usage', '煎法：', '，')); ?>

                                <?php echo e(fe($item, 'dosage', '频次：', '，')); ?>

                                <?php echo e(fe($item, 'frequency', '', '，')); ?>

                                <?php echo e(fe($item, 'dose', '总数：', '付')); ?>

                            </p>
                        <?php elseif($item['type'] == 3): ?>
                            <p>
                                <?php echo e(fe($item, 'name')); ?>

                                <?php echo e(fe($item, 'start_time', '开始于', '，')); ?>

                                <?php echo e(fe($item, 'end_time', '结束于', '，')); ?>

                                <?php echo e(fe($item, 'times_per_day', '每日', '次，')); ?>

                                <?php echo e(fe($item, 'quantity_per_times', '每次')); ?>

                                <?php echo e(fe($item, 'quantity_unit')); ?>

                                <?php echo e(fe($item, 'total', '共', '盒，')); ?>

                            </p>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php endif; ?>
        <?php if(isset($follow) && !is_null($follow)): ?>
            <?php if(isset($follow) && !is_null($follow)): ?>
                <?php $__currentLoopData = $follow['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <p><?php echo e($item); ?></p>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php if(isset($follow['model']->remark)&&!is_null($follow['model']->remark)&&''!=$follow['model']->remark): ?>
                    <p>备注信息：<?php echo e($follow['model']->remark); ?></p>
                <?php endif; ?>
            <?php endif; ?>
        <?php endif; ?>
    <?php endif; ?>
</div>


<?php if(isset($past) && !is_null($past)): ?>
    <div>
        <?php if(!isEmpty($past)): ?>
            <p class="caseTitle">既往史</p>
        <?php endif; ?>
        <div>
            <?php $__currentLoopData = $past['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <p><?php echo $item; ?></p>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
        <?php if($past['model']->operation): ?>
            
            
            
            
            
            
            
            
            
            <?php $__currentLoopData = (array)$past['model']->operation; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <p>
                    <?php echo e(fe($item, 'time','，')); ?>

                    <?php echo e(fe($item, 'name')); ?>

                </p>
                
                
                
                
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            
            
        <?php endif; ?>
        <?php if($past['model']->medication): ?>

            <?php $__currentLoopData = (array)$past['model']->medication; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <p>
                    <?php echo e(fr($item, 'start_time',"：")); ?>

                    <?php echo e(fr($item, 'name','，')); ?>

                    <?php echo e(fr($item,'dosage.type','，')); ?>

                    <?php if('每次剂量' == fr($item,'dosage.type')): ?>
                        <?php echo e($item['dosage']['value'],'，'); ?>

                    <?php else: ?>
                        <?php echo e(fe($item, 'dosage.values.morning', '早', '，')); ?>

                        <?php echo e(fe($item, 'dosage.values.atnoon', '中', '，')); ?>

                        <?php echo e(fe($item, 'dosage.values.evening', '晚', '，')); ?>

                        <?php echo e(fe($item, 'dosage.values.before_sleep', '睡前', '，')); ?>

                    <?php endif; ?>
                    <?php echo e(fr($item, 'dosage.unit','，')); ?>

                    <?php echo e(fr($item, 'usage','，')); ?>

                    <?php echo e(fr($item, 'frequency',' ')); ?>

                    <?php echo e(fr($item, 'remark',' ')); ?>

                </p>
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

        <?php endif; ?>
        <p>
        <?php if(isset($past['model']->remark)&&!is_null($past['model']->remark)&&''!=$past['model']->remark): ?>
            <p>备注信息：<?php echo e($past['model']->remark); ?></p>
            <?php endif; ?>
            </p>
    </div>
<?php endif; ?>


<?php if(isset($person) && !is_null($person)): ?>
    <div>
        <?php if(!isEmpty($person)): ?>
            <p class="caseTitle">个人史</p>
        <?php endif; ?>
        <div>
            <?php $__currentLoopData = $person['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <span><?php echo e($item); ?></span><br>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if(isset($person['model']->remark)&&!is_null($person['model']->remark)&&''!=$person['model']->remark): ?>
                <span>备注信息：<?php echo e($person['model']->remark); ?></span>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>


<?php if(isset($marriage) && !is_null($marriage)): ?>
    <div>
        <?php if(!isEmpty($marriage)): ?>
            <p class="caseTitle">月经婚育史</p>
        <?php endif; ?>
        <div>
            <?php $__currentLoopData = $marriage['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <span><?php echo e($item); ?></span><br>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if(isset($marriage['model']->remark)&&!is_null($marriage['model']->remark)&&''!=$marriage['model']->remark): ?>
                <span>备注信息：<?php echo e($marriage['model']->remark); ?></span>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>


<?php if(isset($family) && !is_null($family)&&!isEmpty($family)): ?>
    <div>
        <p class="caseTitle">家族史</p>
        <div>
            <?php $__currentLoopData = $family['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <?php if($key == 'extend'): ?>
                    <?php $__currentLoopData = explode('；', $item); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($i !== ''): ?>
                            <span><?php echo $i; ?></span>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php else: ?>
                    <span><?php echo e($item); ?></span><br>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if(isset($family['model']->remark)&&!is_null($family['model']->remark)&&''!=$family['model']->remark): ?>
                <span>备注信息：<?php echo e($family['model']->remark); ?></span>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>


<?php if(isset($physical) && !is_null($physical)): ?>
    <div>
        <?php if(!isEmpty($physical)): ?>
            <p class="caseTitle">体格检查</p>
        <?php endif; ?>
        <div>
            <?php $__currentLoopData = $physical['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <span><?php echo $item; ?></span><br>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if(isset($physical['model']->remark)&&!is_null($physical['model']->remark)&&''!=$physical['model']->remark): ?>
                <span>备注信息：<?php echo e($physical['model']->remark); ?></span>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>


<?php if(isset($auxiliary) && !is_null($auxiliary)): ?>
    <div>
        <?php if(!isEmpty($auxiliary)): ?>
            <p class="caseTitle">辅助检查</p>
        <?php endif; ?>
        <div>
            <?php $__currentLoopData = $auxiliary['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <p>检查日期 <?php echo e($key); ?></p>
                <?php $__currentLoopData = $item; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php echo e($value['print']); ?><br>
                    <?php if(isset($value['table'])): ?>
                        <?php echo $value['table']; ?>

                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if(isset($auxiliary['model']->remark)&&!is_null($auxiliary['model']->remark)&&''!=$auxiliary['model']->remark): ?>
                <span>备注信息：<?php echo e($auxiliary['model']->remark); ?></span>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>

<?php if(($complication['is_print'])): ?>
<div>

    <p class="caseTitle">并发症</p>

    <div>
        <?php if(!empty($complication['clinical_symptoms'])): ?>
            <?php echo $complication['clinical_symptoms']; ?>

            <br>
        <?php endif; ?>
        <?php if(!empty($complication['specialty'])): ?>
            <?php echo $complication['specialty']; ?>

            <br>
        <?php endif; ?>
        <?php if(!empty($complication['prompt'])): ?>
            <?php echo $complication['prompt']; ?>

            <br>
        <?php endif; ?>
        <?php if(!empty($complication['auxiliary'])): ?>
            <?php echo $complication['auxiliary']; ?>

            <br>
        <?php endif; ?>

        <?php if(!empty($complication['ordinary'])): ?>
            <?php echo $complication['ordinary']; ?>

            <br>
        <?php endif; ?>
        <?php if(!empty($complication['fundus'])): ?>
            <?php echo $complication['fundus']; ?>

            <br>
        <?php endif; ?>
        <?php if(!empty($complication['retinopathy'])): ?>
            <?php echo $complication['retinopathy']; ?>

            <br>
        <?php endif; ?>
        <?php if(!empty($complication['macular_edema'])): ?>
            <?php echo $complication['macular_edema']; ?>

            <br>
        <?php endif; ?>

    </div>
</div>
<?php endif; ?>

<?php if(isset($diagnose) && !is_null($diagnose)&&!isEmpty($diagnose)): ?>
    <div class="col-xs-offset-7 col-xs-5">
        <?php $__currentLoopData = $diagnose['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <p><?php echo $item; ?></p>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
    <div>
        <?php if(isset($diagnose['model']->remark)&&!is_null($diagnose['model']->remark)&&''!=$diagnose['model']->remark): ?>
            <p>诊断备注：<?php echo e($diagnose['model']->remark); ?></p>
        <?php endif; ?>
    </div>
<?php endif; ?>


<?php if(isset($dispose) && !is_null($dispose)): ?>
    <div>
        <p class="caseTitle">Rx:</p>
        <p><?php echo $dispose['advise']; ?></p>
        <div>
            <?php $__currentLoopData = $dispose['print']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <p><?php echo e($item); ?></p>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
        <?php if($scene->isWestern()): ?>
            <?php if(is_array($dispose['model']['medication'])): ?>
                <?php $__currentLoopData = $dispose['model']['medication']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <p>
                        <?php echo e(fr($item, 'start_time',"：")); ?>

                        <?php echo e(fr($item, 'name','，')); ?>

                        <?php echo e(fr($item, 'usage','，')); ?>

                        
                        <?php if('每次剂量' == fr($item,'dosage.type')): ?>
                            <?php echo e($item['dosage']['value'],'，'); ?>

                        <?php else: ?>
                            <?php echo e(fe($item, 'dosage.values.morning', '早', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.atnoon', '中', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.evening', '晚', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.before_sleep', '睡前', '，')); ?>

                        <?php endif; ?>
                        <?php echo e(fr($item, 'dosage.unit','  ,')); ?>

                        
                        <?php echo e(fr($item, 'frequency',' ')); ?>

                        ;
                        <?php echo e(fr($item, 'remark',' ')); ?>

                    </p>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

            <?php endif; ?>
            <?php if($dispose['model']->cn_medication): ?>

                <?php $__currentLoopData = (array)$dispose['model']->cn_medication; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(!isset($item['type']) || $item['type'] == 1): ?>
                        <p>
                            <?php $__currentLoopData = $item['drugs']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $drug): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php echo e($drug['name']); ?> <?php echo e($drug['weight']); ?>g
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php echo e(fe($item, 'usage', '煎法：', '，')); ?>

                            <?php echo e(fe($item, 'dosage', '频次：', '，')); ?>

                            <?php echo e(fe($item, 'frequency', '', '，')); ?>

                            <?php echo e(fe($item, 'dose', '总数：', '付')); ?>

                        </p>
                    <?php elseif($item['type'] == 3): ?>
                        <p>
                            <?php echo e(fe($item, 'name')); ?>

                            <?php echo e(fe($item, 'start_time', '开始于', '，')); ?>

                            <?php echo e(fe($item, 'end_time', '结束于', '，')); ?>

                            <?php echo e(fe($item, 'times_per_day', '每日', '次，')); ?>

                            <?php echo e(fe($item, 'quantity_per_times', '每次')); ?>

                            <?php echo e(fe($item, 'quantity_unit', '', '，')); ?>

                            <?php echo e(fe($item, 'total', '共', '盒，')); ?>

                        </p>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>
        <?php else: ?>
        
            <?php if(is_array($dispose['model']['medication'])): ?>
                <?php $__currentLoopData = $dispose['model']['medication']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <p>
                        <?php echo e(fr($item, 'start_time',"：")); ?>

                        <?php echo e(fr($item, 'name','，')); ?>

                        <?php echo e(fr($item, 'usage','，')); ?>

                        
                        <?php if('每次剂量' == fr($item,'dosage.type')): ?>
                            <?php echo e($item['dosage']['value'],'，'); ?>

                        <?php else: ?>
                            <?php echo e(fe($item, 'dosage.values.morning', '早', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.atnoon', '中', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.evening', '晚', '，')); ?>

                            <?php echo e(fe($item, 'dosage.values.before_sleep', '睡前', '，')); ?>

                        <?php endif; ?>
                        <?php echo e(fr($item, 'dosage.unit',' , ')); ?>

                        
                        <?php echo e(fr($item, 'frequency',' ')); ?>

                        ;
                        <?php echo e(fr($item, 'remark',' ')); ?>

                    </p>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>
            <?php if($dispose['model']->cn_medication): ?>

                <?php $__currentLoopData = (array)$dispose['model']->cn_medication; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(!isset($item['type']) || $item['type'] == 1): ?>
                        <p>
                            <?php $__currentLoopData = $item['drugs']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $drug): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php echo e($drug['name']); ?> <?php echo e($drug['weight']); ?>g
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php echo e(fe($item, 'usage', '煎法：', '，')); ?>

                            <?php echo e(fe($item, 'dosage', '频次：', '，')); ?>

                            <?php echo e(fe($item, 'frequency', '', '，')); ?>

                            <?php echo e(fe($item, 'dose', '总数：', '付')); ?>

                        </p>
                    <?php elseif($item['type'] == 3): ?>
                        <p>
                            <?php echo e(fe($item, 'name')); ?>

                            <?php echo e(fe($item, 'start_time', '开始于', '，')); ?>

                            <?php echo e(fe($item, 'end_time', '结束于', '，')); ?>

                            <?php echo e(fe($item, 'times_per_day', '每日', '次，')); ?>

                            <?php echo e(fe($item, 'quantity_per_times', '每次')); ?>

                            <?php echo e(fe($item, 'quantity_unit', '', '，')); ?>

                            <?php echo e(fe($item, 'total', '共', '盒，')); ?>

                        </p>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>
        <?php endif; ?>
        
        <?php if(isset($dispose['model']->remark)&&!is_null($dispose['model']->remark)&&''!=$dispose['model']->remark): ?>
            <p>备注信息：<?php echo e($dispose['model']->remark); ?></p>
        <?php endif; ?>
    </div>
<?php endif; ?>


<div class="signature">
    <p class="text-right">医生签名：</p>
</div>